import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:my_app/app/modules/permission_tool/permission_tool_controller.dart';

/// permission_tool_page.dart
///
/// Created by fuchuanwei on Thu Feb 23 2023.
///
/// Description: 权限处理页面
///
class PermissionPage extends GetView<PermissionToolController> {
  @override
  Widget build(BuildContext context) {
    Get.put(PermissionToolController());
    return Scaffold(
      appBar: AppBar(title: Text('权限处理')),
      body: ListView(
        padding: EdgeInsets.all(10.0),
        children: [
          ElevatedButton(
            onPressed: () => controller.requestCameraPermission(),
            child: Text('请求拍照权限'),
          ),
          ElevatedButton(
            onPressed: () => controller.requestStoragePermission(),
            child: Text('请求存储权限'),
          ),
          ElevatedButton(
            onPressed: () => controller.requestLocationPermission(),
            child: Text('请求位置权限'),
          ),
          ElevatedButton(
            onPressed: () => controller.requestContactsPermission(),
            child: Text('请求通讯录权限'),
          ),
        ],
      ),
    );
  }
}
